#!/usr/bin/env python

# Imports
import pygtk
pygtk.require('2.0')
import gtk
import gobject
from biblioteca import *

def destroy(self):
   gtk.main_quit()

def main():
   gtk.main()
   return 0

if __name__ == "__main__":

   window.set_title("SimpleLogo")
   window.set_default_size(CANVAS_X,CANVAS_Y)
   window.set_position(gtk.WIN_POS_CENTER)
   window.connect("destroy", destroy)

   area.set_size_request(CANVAS_X,CANVAS_Y)
   window.add(area)
   area.show()
   area.modify_bg(gtk.STATE_NORMAL, bg_color)

   window.show()

   go(0,0) # Inicia a execucao

   # A execucao deve ser escrita daqui em diante
   #pencolor(0,255,0)
   #canvascolor(0,0,255)
   #go(0,0)
   #go(300,300)
   #for i in range(0,4):
   #   forward(100)
   #   turnright(90)
   #for i in range(0,4):
   #   turnleft(90)
   #   forward(100)
   #reset()
   #gox(500)
   #penup()
   #goy(200)
   #pendown()
   #gox(100)

   # NEWAY
   #penwidth(5)
   go(250,300)
   for i in range(0,6):
      forward(100)
      turnleft(60)
   #penwidth(2)
   for i in range(0,4):
      forward(100)
      direction(90*(i+1))
   #wait(2)
   penup()
   go(270,300)
   print_string("NeWaY")

   #forward(300)
   #backward(200)
   #forward(300)
   
   # Depois de compilar, escrever a linha a seguir
   main()
